<template>
  <div class="progress" ref="progress">进度条</div>
</template>


<script>
import * as echarts from "echarts";
export default {
  name: "ProgressChart",
  components: {},
  data() {
    return {};
  },
  mounted() {
    /** @type EChartsOption */
    let mychart = echarts.init(this.$refs.progress);
    mychart.setOption({
      xAxis: {
        show: false,
        min: 0,
        max: 100,
      },
      grid: {
        left: 0,
      },
      yAxis: {
        show: false,
        type: "category",
      },
      series: [
        {
          type: "bar",
          data: [45],
          color: "pink",
          barWidth: 10,
          //背景颜色设置
          showBackground: true,
          //设置背景颜色
          backgroundStyle: {
            color: "#eee",
          },
          //文本标签
          label: {
            show: true,
            //改变文本内容
            formatter: "|",
            //文本标签位置调试
            position: "right",
          },
        },
      ],
    });
  },
};
</script>



<style scoped>
.progress {
  width: 100%;
  height: 100%;
}
</style>